package cl.solidit.geomanagement.persistance;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import cl.solidit.geomanagement.persistance.model.Upload;

@Repository
public class UploadDAO {
	@PersistenceContext
	private EntityManager em;
	@Transactional
	public void save(Upload upload) {
		em.persist(upload);
	}
	
	@Transactional
	public Upload byId(Long id) {
		return em.find(Upload.class, id);
	}
}
